package com.yzh.ios4;

import java.io.*;

/**
 * @author 于振晗
 * @title: CopyTest4
 * @description: TODO 缓冲流
 * @date 2020年09月07日
 * @path com.yzh.ios
 */
public class CopyTest4 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("d:/test1.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:/test3.txt"));

        byte [] buf = new byte[1024];
        int len = 0;
        while ((len = bis.read(buf)) != -1) {
            bos.write(buf,0,len);
        }
        bis.close();
        bos.close();
    }
}
